package cn.bluech.template.webserver;

import cn.bluech.lib.http.HttpBuilder;

/**
 * Description:
 * Create by Codeant on 2019/3/13.
 */
public class HttpModel {
    private static final String SERVER_URL = "https://www.baidu.com/";
    private static HttpModel instance;
    private HttpApi api;

    public static HttpModel getInstance(){
        if(null!=instance)
            return instance;
        synchronized (HttpModel.class){
            if(null==instance)
                instance = new HttpModel();
            return instance;
        }
    }

    private HttpModel(){
        api = new HttpBuilder(SERVER_URL).build(HttpApi.class);
    }

    public HttpApi getApi() {
        return api;
    }
}
